<!DOCTYPE html>
<!--
  ~ Copyright (c) 2017.
  ~ 网址：http://goour.cn
  ~ 作者：侯坤林
  ~ 邮箱：lscode@qq.com
  ~ 侯坤林 版权所有
  ~
  -->

<html xmlns:th="http://www.thymeleaf.org" xmlns:v-on="http://www.w3.org/1999/xhtml"
	  xmlns:v-bind="http://www.w3.org/1999/xhtml">

	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<title>小K服务后台管理系统</title>
		<meta name="keywords" content="">
		<meta name="description" content="">

		<link rel="shortcut icon" href="../../../../static/favicon.ico" th:href="@{/favicon.ico}">

		<link rel="stylesheet" type="text/css" href="../../../../static/bootstrap/css/bootstrap.min.css" th:href="@{/bootstrap/css/bootstrap.min.css}" />
		<link rel="stylesheet" type="text/css" href="../../../../static/plugins/iCheck/custom.css" th:href="@{/plugins/iCheck/custom.css}" />
        <link rel="stylesheet" type="text/css" href="../../../../static/plugins/switchery/switchery.css" th:href="@{/plugins/switchery/switchery.css}" />
        <link rel="stylesheet" type="text/css" href="../../../../static/plugins/layui/css/layui.css" th:href="@{/plugins/layui/css/layui.css}" />
        <link rel="stylesheet" type="text/css" href="../../../../static/web/admin/css/font-awesome.css" th:href="@{/web/admin/css/font-awesome.css}" />
        <link rel="stylesheet" type="text/css" href="../../../../static/web/admin/css/animate.css" th:href="@{/web/admin/css/animate.css}" />
        <link rel="stylesheet" type="text/css" href="../../../../static/web/admin/css/style.css" th:href="@{/web/admin/css/style.css}" />

		<style type="text/css">
			table td,
			table th {
				text-align: center;
			}
		</style>
	</head>

	<body class="gray-bg">
		<div class="wrapper wrapper-content animated fadeInRight" id="body">
			<div class="row">
			<div class="col-sm-12">
					<div class="ibox float-e-margins">
						<div class="ibox-title">
							<h5>系统设置  <small>系统信息设置</small></h5>
						</div>
						<div class="ibox-content">
							<form method="get" class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">IP查询提示</label>

									<div class="col-sm-10">
										<div class="input-group">
											<input type="text" class="form-control" v-model="searchIp"> <span class="input-group-btn"> <button type="button" v-on:click="searchIpBtn" class="btn btn-primary">保存
                                        </button> </span>
										</div>
										<span class="help-block m-b-none">查询IP成功时会提示该内容，建议不要为空</span>
									</div>
								</div>
								<div class="hr-line-dashed"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">登录页面提示</label>

									<div class="col-sm-10">
										<div class="input-group">
											<input type="text" class="form-control" v-model="loginInfo" placeholder="用户登录页面提示（可空）"> <span class="input-group-btn"> <button type="button" v-on:click="loginInfoBtn" class="btn btn-primary">保存
                                        </button> </span>
										</div>
										<span class="help-block m-b-none">在用户登录页面下方会提示该内容</span>
									</div>
								</div>
								<div class="hr-line-dashed"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">公告</label>

									<div class="col-sm-10">
										<div class="input-group">
											<input type="text" class="form-control" v-model="information" placeholder="公告内容（可空）"> <span class="input-group-btn"> <button type="button" v-on:click="informationBtn" class="btn btn-primary">保存
                                        </button> </span>
										</div>
										<span class="help-block m-b-none">用户登录后可在主页看到公告标识</span>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>

			</div>

		</div>

		<script src="../../../../static/plugins/jquery.min.js" th:src="@{/plugins/jquery.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/bootstrap/js/bootstrap.min.js" th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/plugins/vuejs/vue.min.js" th:src="@{/plugins/vuejs/vue.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/plugins/layui/layui.js" th:src="@{/plugins/layui/layui.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/web/admin/js/content.js" th:src="@{/web/admin/js/content.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/plugins/switchery/switchery.js" th:src="@{/plugins/switchery/switchery.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/plugins/peity/jquery.peity.min.js" th:src="@{/plugins/peity/jquery.peity.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../../../../static/plugins/iCheck/icheck.min.js" th:src="@{/plugins/iCheck/icheck.min.js}" type="text/javascript" charset="utf-8"></script>
		<!--<script src="../../../static/web/js/demo/peity-demo.js" th:src="@{/web/js/demo/peity-demo.js}" type="text/javascript" charset="utf-8"></script>-->
		<script src="../../../../static/URL.js" th:src="@{/URL.js}"></script>
		<script th:inline="javascript">
            /*<![CDATA[*/
            layui.use(['layer'], function(){
                var layer = layui.layer;
                //使用模块
                var app = new Vue({
                    el: '#body',
                    data: {
                        searchIp:/*[[${application.searchIp}]]*/"",
                        loginInfo:/*[[${application.loginInfo}]]*/"",
                        information:/*[[${application.information}]]*/""
                    },
                    methods: {
                        searchIpBtn: function() {
                            $.ajax({
                                type: "post",
                                data: {text:app.searchIp},
                                url: "setting/searchIp",
                                async: true,
                                dataType: "json",
                                success: function(data) {
                                    if(data.code === 0){
                                        layui.layer.msg(data.msg, {time: 5000,btn: ['明白了']});
                                    }else{
                                        layui.layer.msg(data.msg, {time: 20000,btn: ['明白了']});
                                    }
                                },
                                error: function() {
                                    layui.layer.msg("加载错误");
                                }
                            });
                        },
                        loginInfoBtn: function() {
                            $.ajax({
                                type: "post",
                                data: {text:app.loginInfo},
                                url: "setting/loginInfo",
                                async: true,
                                dataType: "json",
                                success: function(data) {
                                    if(data.code === 0){
                                        layui.layer.msg(data.msg, {time: 5000,btn: ['明白了']});
                                    }else{
                                        layui.layer.msg(data.msg, {time: 20000,btn: ['明白了']});
                                    }
                                },
                                error: function() {
                                    layui.layer.msg("加载错误");
                                }
                            });
                        },
                        informationBtn: function() {
                            $.ajax({
                                type: "post",
                                data: {text:app.information},
                                url: "setting/information",
                                async: true,
                                dataType: "json",
                                success: function(data) {
                                    if(data.code === 0){
                                        layui.layer.msg(data.msg, {time: 5000,btn: ['明白了']});
                                    }else{
                                        layui.layer.msg(data.msg, {time: 20000,btn: ['明白了']});
                                    }
                                },
                                error: function() {
                                    layui.layer.msg("加载错误");
                                }
                            });
                        }
                    }
                });
            });
            /*]]>*/
		</script>
	</body>

</html>